<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<script type="text/javascript" src="${ctx}/page/member/js/address.js"></script>
<script type="text/javascript" src="${ctx}/page/member/js/myAddress.js"></script>
<div class="panel panel-default">
	<div class="panel-heading">
		收货地址 
	</div>

	<div id="list" class="panel-body">
		<c:if test="${address ne null}">
			<ul class="list-group">
				<li class="list-group-item">收货人：${address.name}</li>
				<li class="list-group-item">手机号：${address.mobile}</li>
				<li class="list-group-item">所在地区：${address.province}${address.city}${address.district}</li>
				<li class="list-group-item">详细地址：${address.detail}</li>
			</ul>
			<button type="button" onclick="update()" class="btn btn-default">修改</button>
		</c:if>
		<c:if test="${address eq null}">
			<div class="form-group">
				<label for="name">收货人</label> 
				<input type="text"	class="form-control" id="name" value="${address.name}" />
			</div>
			<div class="form-group">
				<label for="mobile">手机号</label> 
				<input type="text"	class="form-control" id="mobile" value="${address.mobile}" />
			</div>
			<div class="form-group">
				<p>
					<label for="district">所在地区</label>
				</p>
				<select id="cmbProvince" name="cmbProvince"></select> 
				<select id="cmbCity" name="cmbCity"></select> 
				<select id="cmbArea" name="cmbArea"></select>
			</div>
			<div class="form-group">
				<label for="detail">详细地址</label> 
				<input type="text" class="form-control" id="detail" value="${address.detail}" />
			</div>
			<button type="button" onclick="addUpdateAddress()" class="btn btn-default">保存设置</button>
			<span id="error_message"></span>
		</c:if>
	</div>
	<input type="hidden" class="form-control" id="nameHide" value="${address.name}" />
	<input type="hidden" class="form-control" id="mobileHide" value="${address.mobile}" />
	<input type="hidden" class="form-control" id="detailHide" value="${address.detail}" />
</div>
 <script type="text/javascript">  
 	addressInit('cmbProvince', 'cmbCity', 'cmbArea');  
</script>


